\hypertarget{front__panel_2init_8c}{
\section{front\_\-panel/init.c File Reference}
\label{front__panel_2init_8c}\index{front\_\-panel/init.c@{front\_\-panel/init.c}}
}
Initialization routines for the front panel.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$avr/io.h$>$}\par
{\tt \#include $<$avr/interrupt.h$>$}\par
{\tt \#include \char`\"{}usart.h\char`\"{}}\par
{\tt \#include \char`\"{}board.h\char`\"{}}\par
\subsection*{Defines}
\begin{CompactItemize}
\item 
\hypertarget{front__panel_2init_8c_6ce37a080cbe4df58e0938309e4eb207}{
\#define \hyperlink{front__panel_2init_8c_6ce37a080cbe4df58e0938309e4eb207}{OCR0\_\-1MS}~14}
\label{front__panel_2init_8c_6ce37a080cbe4df58e0938309e4eb207}

\begin{CompactList}\small\item\em Used for timer compare to match 1 ms. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void \hyperlink{front__panel_2init_8c_168d1d788d3c0045374fd84be5b8f492}{init\_\-usart\_\-computer} (void)
\item 
void \hyperlink{front__panel_2init_8c_d9b40dee04f1b7ced79b74fe3f6cb7fd}{init\_\-usart} (void)
\item 
void \hyperlink{front__panel_2init_8c_64c88f8f419036c766c3b881335d75f4}{init\_\-timer\_\-0} (void)
\item 
void \hyperlink{front__panel_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}{init\_\-timer\_\-2} (void)
\item 
void \hyperlink{front__panel_2init_8c_41959d20756307f8b73709871cc2bf47}{init\_\-ports} (void)
\item 
void \hyperlink{front__panel_2init_8c_da88b09254ab04468cc50270c98aa647}{init\_\-backlight} (void)
\end{CompactItemize}


\subsection{Detailed Description}
Initialization routines for the front panel. 

\begin{Desc}
\item[Author:]Mikael Larsmark, SM2WMV \end{Desc}
\begin{Desc}
\item[Date:]2010-01-25 

\begin{Code}\begin{verbatim} #include "front_panel/init.c" 
\end{verbatim}
\end{Code}

 \end{Desc}


Definition in file \hyperlink{front__panel_2init_8c-source}{init.c}.

\subsection{Function Documentation}
\hypertarget{front__panel_2init_8c_da88b09254ab04468cc50270c98aa647}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-backlight@{init\_\-backlight}}
\index{init\_\-backlight@{init\_\-backlight}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-backlight}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-backlight (void)}}
\label{front__panel_2init_8c_da88b09254ab04468cc50270c98aa647}


Initialize the backlight (Which is pulse width modulated so we can set the contrast) 

Definition at line 105 of file init.c.

Referenced by main().\hypertarget{front__panel_2init_8c_41959d20756307f8b73709871cc2bf47}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-ports@{init\_\-ports}}
\index{init\_\-ports@{init\_\-ports}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-ports}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-ports (void)}}
\label{front__panel_2init_8c_41959d20756307f8b73709871cc2bf47}


Set the direction of the ports 

Definition at line 72 of file init.c.

References BUTTON1\_\-RX\_\-BIT, BUTTON1\_\-TX\_\-BIT, BUTTON2\_\-RX\_\-BIT, BUTTON2\_\-TX\_\-BIT, BUTTON3\_\-RX\_\-BIT, BUTTON3\_\-TX\_\-BIT, BUTTON4\_\-RX\_\-BIT, BUTTON4\_\-TX\_\-BIT, BUTTON\_\-AUX1\_\-BIT, BUTTON\_\-AUX2\_\-BIT, BUTTON\_\-MENU\_\-BIT, BUTTON\_\-PULSE\_\-BIT, BUTTON\_\-ROTATE\_\-BIT, BUTTON\_\-RXANT\_\-BIT, BUTTON\_\-SUBMENU\_\-BIT, and BUTTON\_\-TXRX\_\-BIT.\hypertarget{front__panel_2init_8c_64c88f8f419036c766c3b881335d75f4}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-timer\_\-0@{init\_\-timer\_\-0}}
\index{init\_\-timer\_\-0@{init\_\-timer\_\-0}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-timer\_\-0}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-timer\_\-0 (void)}}
\label{front__panel_2init_8c_64c88f8f419036c766c3b881335d75f4}


Initialize timer0 to use the main crystal clock and the output compare interrupt feature to generate an interrupt approximately once per millisecond to use as a general purpose time base. 

Definition at line 51 of file init.c.

References OCR0\_\-1MS.\hypertarget{front__panel_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-timer\_\-2@{init\_\-timer\_\-2}}
\index{init\_\-timer\_\-2@{init\_\-timer\_\-2}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-timer\_\-2}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-timer\_\-2 (void)}}
\label{front__panel_2init_8c_a9d25e6ae6cdd28863148176ab274ec9}


Initializes timer 2 

Definition at line 62 of file init.c.\hypertarget{front__panel_2init_8c_d9b40dee04f1b7ced79b74fe3f6cb7fd}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-usart@{init\_\-usart}}
\index{init\_\-usart@{init\_\-usart}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-usart}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-usart (void)}}
\label{front__panel_2init_8c_d9b40dee04f1b7ced79b74fe3f6cb7fd}


Initializes the USART for the communication bus 

Definition at line 41 of file init.c.

Referenced by main().\hypertarget{front__panel_2init_8c_168d1d788d3c0045374fd84be5b8f492}{
\index{front\_\-panel/init.c@{front\_\-panel/init.c}!init\_\-usart\_\-computer@{init\_\-usart\_\-computer}}
\index{init\_\-usart\_\-computer@{init\_\-usart\_\-computer}!front_panel/init.c@{front\_\-panel/init.c}}
\subsubsection[{init\_\-usart\_\-computer}]{\setlength{\rightskip}{0pt plus 5cm}void init\_\-usart\_\-computer (void)}}
\label{front__panel_2init_8c_168d1d788d3c0045374fd84be5b8f492}


Init the UART for the computer communication 

Definition at line 33 of file init.c.

References usart1\_\-init(), usart1\_\-receive\_\-loopback(), and usart1\_\-transmit().

Referenced by main().